3.184 \(\int \frac{\cos ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx\)

Optimal. Leaf size=76 \[ \frac{b^2 \tanh ^{-1}\left (\frac{\sqrt{a} \sin (e+f x)}{\sqrt{a+b}}\right )}{a^{5/2} f \sqrt{a+b}}+\frac{(a-b) \sin (e+f x)}{a^2 f}-\frac{\sin ^3(e+f x)}{3 a f} \]

[Out]

(b^2*ArcTanh[(Sqrt[a]*Sin[e + f*x])/Sqrt[a + b]])/(a^(5/2)*Sqrt[a + b]*f) + ((a - b)*Sin[e + f*x])/(a^2*f) - S
in[e + f*x]^3/(3*a*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0890151, antiderivative size = 76, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {4147, 390, 208} \[ \frac{b^2 \tanh ^{-1}\left (\frac{\sqrt{a} \sin (e+f x)}{\sqrt{a+b}}\right )}{a^{5/2} f \sqrt{a+b}}+\frac{(a-b) \sin (e+f x)}{a^2 f}-\frac{\sin ^3(e+f x)}{3 a f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]^3/(a + b*Sec[e + f*x]^2),x]

[Out]

(b^2*ArcTanh[(Sqrt[a]*Sin[e + f*x])/Sqrt[a + b]])/(a^(5/2)*Sqrt[a + b]*f) + ((a - b)*Sin[e + f*x])/(a^2*f) - S
in[e + f*x]^3/(3*a*f)

Rule 4147

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fr
eeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2*x^2)^
((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n
/2] && IntegerQ[p]

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{\cos ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^2}{a+b-a x^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{a-b}{a^2}-\frac{x^2}{a}+\frac{b^2}{a^2 \left (a+b-a x^2\right )}\right ) \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{(a-b) \sin (e+f x)}{a^2 f}-\frac{\sin ^3(e+f x)}{3 a f}+\frac{b^2 \operatorname{Subst}\left (\int \frac{1}{a+b-a x^2} \, dx,x,\sin (e+f x)\right )}{a^2 f}\\ &=\frac{b^2 \tanh ^{-1}\left (\frac{\sqrt{a} \sin (e+f x)}{\sqrt{a+b}}\right )}{a^{5/2} \sqrt{a+b} f}+\frac{(a-b) \sin (e+f x)}{a^2 f}-\frac{\sin ^3(e+f x)}{3 a f}\\ \end{align*}

Mathematica [A]  time = 0.299817, size = 105, normalized size = 1.38 \[ \frac{a^{3/2} \sin (3 (e+f x))+\frac{6 b^2 \left (\log \left (\sqrt{a+b}+\sqrt{a} \sin (e+f x)\right )-\log \left (\sqrt{a+b}-\sqrt{a} \sin (e+f x)\right )\right )}{\sqrt{a+b}}+3 \sqrt{a} (3 a-4 b) \sin (e+f x)}{12 a^{5/2} f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]^3/(a + b*Sec[e + f*x]^2),x]

[Out]

((6*b^2*(-Log[Sqrt[a + b] - Sqrt[a]*Sin[e + f*x]] + Log[Sqrt[a + b] + Sqrt[a]*Sin[e + f*x]]))/Sqrt[a + b] + 3*
Sqrt[a]*(3*a - 4*b)*Sin[e + f*x] + a^(3/2)*Sin[3*(e + f*x)])/(12*a^(5/2)*f)

________________________________________________________________________________________

Maple [A]  time = 0.097, size = 70, normalized size = 0.9 \begin{align*}{\frac{1}{f} \left ( -{\frac{1}{{a}^{2}} \left ({\frac{a \left ( \sin \left ( fx+e \right ) \right ) ^{3}}{3}}-\sin \left ( fx+e \right ) a+\sin \left ( fx+e \right ) b \right ) }+{\frac{{b}^{2}}{{a}^{2}}{\it Artanh} \left ({\sin \left ( fx+e \right ) a{\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)^3/(a+b*sec(f*x+e)^2),x)

[Out]

1/f*(-1/a^2*(1/3*a*sin(f*x+e)^3-sin(f*x+e)*a+sin(f*x+e)*b)+b^2/a^2/((a+b)*a)^(1/2)*arctanh(a*sin(f*x+e)/((a+b)
*a)^(1/2)))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 0.550273, size = 517, normalized size = 6.8 \begin{align*} \left [\frac{3 \, \sqrt{a^{2} + a b} b^{2} \log \left (-\frac{a \cos \left (f x + e\right )^{2} - 2 \, \sqrt{a^{2} + a b} \sin \left (f x + e\right ) - 2 \, a - b}{a \cos \left (f x + e\right )^{2} + b}\right ) + 2 \,{\left (2 \, a^{3} - a^{2} b - 3 \, a b^{2} +{\left (a^{3} + a^{2} b\right )} \cos \left (f x + e\right )^{2}\right )} \sin \left (f x + e\right )}{6 \,{\left (a^{4} + a^{3} b\right )} f}, -\frac{3 \, \sqrt{-a^{2} - a b} b^{2} \arctan \left (\frac{\sqrt{-a^{2} - a b} \sin \left (f x + e\right )}{a + b}\right ) -{\left (2 \, a^{3} - a^{2} b - 3 \, a b^{2} +{\left (a^{3} + a^{2} b\right )} \cos \left (f x + e\right )^{2}\right )} \sin \left (f x + e\right )}{3 \,{\left (a^{4} + a^{3} b\right )} f}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

[1/6*(3*sqrt(a^2 + a*b)*b^2*log(-(a*cos(f*x + e)^2 - 2*sqrt(a^2 + a*b)*sin(f*x + e) - 2*a - b)/(a*cos(f*x + e)
^2 + b)) + 2*(2*a^3 - a^2*b - 3*a*b^2 + (a^3 + a^2*b)*cos(f*x + e)^2)*sin(f*x + e))/((a^4 + a^3*b)*f), -1/3*(3
*sqrt(-a^2 - a*b)*b^2*arctan(sqrt(-a^2 - a*b)*sin(f*x + e)/(a + b)) - (2*a^3 - a^2*b - 3*a*b^2 + (a^3 + a^2*b)
*cos(f*x + e)^2)*sin(f*x + e))/((a^4 + a^3*b)*f)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)**3/(a+b*sec(f*x+e)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.26462, size = 120, normalized size = 1.58 \begin{align*} -\frac{\frac{3 \, b^{2} \arctan \left (\frac{a \sin \left (f x + e\right )}{\sqrt{-a^{2} - a b}}\right )}{\sqrt{-a^{2} - a b} a^{2}} + \frac{a^{2} \sin \left (f x + e\right )^{3} - 3 \, a^{2} \sin \left (f x + e\right ) + 3 \, a b \sin \left (f x + e\right )}{a^{3}}}{3 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

-1/3*(3*b^2*arctan(a*sin(f*x + e)/sqrt(-a^2 - a*b))/(sqrt(-a^2 - a*b)*a^2) + (a^2*sin(f*x + e)^3 - 3*a^2*sin(f
*x + e) + 3*a*b*sin(f*x + e))/a^3)/f